/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package cn.itcast;

import java.util.Random;

/**
 * <p>Project: JavaStudy - Forme
 * <p>Powered by jiangbo On 2023-02-25
 * 14:51:00
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class For5me {

    public static void main(String[] args) {
        //思路
        for (int a=0;a<10;a++){
            for (int b=0;b<a;b++){
                System.out.print("*");
            }
            System.out.println();
        }
        for (int a=10;a>0;a--){
            for (int b=0;b<a;b++){
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println("#".repeat(35));
        //lingxing
        int db=1;//存在y
        int da=9;//循环-1 循环=z;z-1
        //sum=x
        for (int d=0;d<10 ;d++){
            System.out.print(" ".repeat(da));
            System.out.println("*".repeat(db));
            db=db+2;
            da--;
        }
        int db2=19;//循环X2+1;2z+1
        int da2=0;//0-循环
        for (int d=0;d<9 ;d++){
            db2=db2-2;
            da2++;
            System.out.print(" ".repeat(da2));
            System.out.println("*".repeat(db2));
        }
        System.out.println("#".repeat(35));
        //菱形
        Random Rand = new Random();
        int num = Rand.nextInt(0, 50);
        System.out.println(num);
        int All=15;
        int count=All;
        int A=1;
        int B=All*2-1;
        for (int d=0;d<All ;d++){
            System.out.print(" ".repeat(count));
            System.out.println("*".repeat(A));
            A=A+2;
            count--;
        }
        for (int d=0;d<All-1 ;d++){
            B=B-2;
            System.out.print(" ".repeat(d+2));
            System.out.println("*".repeat(B));
        }

    }
}


